#include "String.h"


void Teststring1()
{
	yyp::string s;
	s.push_back('2');
	s.push_back('3');
	s.push_back('4');
	s.push_back('a');
	s.push_back('b');
	s.push_back('c');
}

void Teststring2()
{
    class Sln1
    {
    public:
        string reverseWords(string s)
        {
            size_t pos = s.find_first_of(' ');
            size_t prev = 0;

            if (pos != string::npos)
            {
                while (true)
                {
                    if (pos != string::npos)
                    {
                        reverse(s.begin() + prev, s.begin() + pos);

                        prev = pos + 1;
                        pos = s.find_first_of(' ', pos + 1);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            reverse(s.begin() + prev, s.end());

            return s;
        }
    };

    class Sln2
    {
    public:
        int firstUniqChar(string s)
        {
            int cnt[129] = { 0 };

            for (int i = 0; i < s.size(); ++i)
            {
                cnt[s[i]]++;
            }

            for (int i = 0; i < s.size(); ++i)
            {
                if (1 == cnt[s[i]])
                    return i;
            }

            return -1;
        }
    };

}

int main()
{
	//Teststring1();

	return 0;
}